<script>
function deletemethod(id) {
	if(confirm('Are you sure you want to delete this shipping method?')) {
		window.location = '<?=base_url()?>admin/system/deleteshipping/' + id;
	}
}
function createmethod() {
	window.location = '<?=base_url()?>admin/system/shipping/add';
}
</script>
    	<div class="left">
        	<h1>System Settings</h1>
            <div class="bar">

            	<div class="text">Shipping Methods</div>
            	<div class="cr"></div>
            </div>
            <div class="box">
            	<h3>Methods List</h3>
                <div class="row-title">
                	<div class="cat-name">Method name</div>                    
                    <div class="cat-func">Delete</div>
                    <div class="cat-func">Active</div>
                    <div class="cat-func">Edit</div>
                    <div class="cat-func2">Price</div>
                    <div class="cat-func2">Created</div>
                </div>
                <div id="subcat">
                	<?php foreach($shippings as $ship) { $created = date('d-m-Y',strtotime($ship['created'])); ?>
                	<div class="row-item<?php if($ship['default'] == 1) print ' row-default'; ?>">
                        <div class="cat-name"><?=$ship['name']?></div>
                        <div class="cat-func"><a href="javascript:deletemethod(<?=$ship['id']?>)" title="Delete this method"><img src="<?=base_url()?>img/backend/icon-delete.png" /></a></div>
                        <?php if($ship['actived'] == 1) { ?>
                        <div class="cat-func"><a href="<?=base_url()?>admin/system/activeshipping/<?=$ship['id']?>" title="De-active this method"><img src="<?=base_url()?>img/backend/icon-actived.png" /></a></div>
                        <?php } else if($ship['actived'] == 0) { ?>
                        <div class="cat-func"><a href="<?=base_url()?>admin/system/activeshipping/<?=$ship['id']?>" title="Active this method"><img src="<?=base_url()?>img/backend/icon-inactived.png" /></a></div>
                        <?php } ?>
                        <div class="cat-func"><a href="<?=base_url()?>admin/system/shipping/edit/<?=$ship['id']?>" title="Edit this method"><img src="<?=base_url()?>img/backend/icon-view.png" /></a></div>
                        <div class="cat-func2">$<?=$ship['price_value']?></div>
                        <div class="cat-func2"><?=$created?></div>
                    </div>
                    <?php } ?>
                </div>
            </div>
            <div class="box">
            	<input type="button" class="button rounded" value="Create a new shipping method" onclick="createmethod()" />
            </div>
        </div>
        
